import React, { useContext } from "react";
import globalLoading from "./globalLoading";
import userInfo from "./userInfo";
// import userInfoNew from "./userInfoNew";
class RootStore { 
    constructor() {
        this.globalLoading = new globalLoading();
        this.userInfo = new userInfo();
        // this.userInfoNew = new userInfoNew();
    }
}
export const rootStore = new RootStore();
const MyContext = React.createContext(rootStore);
export { MyContext }
export const useStore = () => {
    const store = useContext(MyContext);
    if (!store) {
      throw new Error('useStore must be used within StoreProvider');
    }
    return store;
};